<extend name="Base:base" />
<block name="base_main">
<style>
input{outline:none} 
</style>
<div class="am-g myapp-login" style=" background:url(__PUBLIC__/seller/img/bg.png); center">
	<div class="myapp-login-logo-block  tpl-login-max">
		<div class="myapp-login-logo-text" style=" margin-top:10%;">
        	<div style=" width:268px; height:182px;  margin:50px auto; background:url(__PUBLIC__/seller/img/login_logo.png);"></div>
		</div>
		<div class="am-u-sm-10 login-am-center">
			<form class="am-form1">
				<fieldset>
					<div class="am-form-group" style="margin-bottom:20px;">
                    	<div style="width:494px; height:73px; background:url(__PUBLIC__/seller/img/login_03.png);">
                        	<input type="text" class="" id="user" style=" width:380px; height:73px; padding:0px 20px; float:right; color:#fff; background:none; font-size:26px;" >
                        </div>
					</div>
                    <div class="am-form-group">
                    	<div style="width:494px; height:73px; background:url(__PUBLIC__/seller/img/login_06.png);">
                            <input type="password" class="" id="pass" style=" width:380px; height:73px; padding:0px 20px; float:right; color:#fff; background:none; font-size:26px;" >
                        </div>
					</div>
					<p><button type="button" id="ajax_login_submit" class="am-btn am-btn-default" style=" width:494px; height:62px; background:url(__PUBLIC__/seller/img/login_08.png)"></button></p>
                                        <p><a type="button" href="{:U('register')}" id="ajax_login_submit" class="am-btn am-btn-default"  style=" width:494px; height:62px; background:url(__PUBLIC__/seller/img/login_10.png)"></a></p>
				</fieldset>
			</form>
		</div>
            	
			<div style="text-align: center;color: white;">
				本平台现有商家{$info['customerCount']}家，供货产品有{$info['supplyCount']}个！
			</div>
	
	</div>
</div>
<script>
	$('#ajax_login_submit').click(function(){
		var user = $('#user').val();
		var pass = $('#pass').val();
		if( user == '' ) {
			error('商家账户不能为空。' );
			return false;			
		}
		if( pass == '' ) {
			error('登录密码不能为空');
			return false;			
		}
		$.post('{:U('Public/loginChecked')}' , { user : user , pass : pass } , function(data) {
			if( data.status == 1 ) {
				success( data.info , function(opt){
					location.href = data.url;
				} );
			} else{
				error( data.info );
			}
		}, 'json');
	});
</script>
</block>